$(function () {
    $('#pageTotal').change(function () {

    })
})
layui.use(['laypage', 'layer','form'], function(){

    var laypage = layui.laypage
        ,layer = layui.layer;
    var form = layui.form;

    var pageTotal=$('#pageTotal').val()
    var pPageTotal=parseInt(pageTotal);
    console.log("pageNo:"+vm.pageNum+",pageSize:"+vm.pageSize+",pageTotal:"+pageTotal+",pPageTotal:"+pPageTotal);
    //完整功能
    laypage.render({
        elem: 'pageDemo'
        ,limit: vm.pageSize
        ,limits: [5,10,20,50,100]
        ,curr: vm.pageNum
        ,count: vm.pageTotal
        ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
        ,jump: function(obj,first){
            //首次不执行
            if(!first){
                console.log(obj);
                $("#pageNo").val(obj.curr);
                $("#pageSize").val(obj.limit);
                vm.inputSearch();
            }
        }
    });

});